package com.example.myproject.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by xi on 2018/7/14.
 */
public class PhoneNumberUtilTest {

    public static void test(String phone ){
        //00+国际区号+区号+号码+分机号
        String regexp = "^00\\-?((\\d{2,4}\\-?)+(\\d{2,3})\\-?)+(\\d{7,8})(\\-?(\\d{3,}))?$";
        Pattern regex = Pattern.compile(regexp);
        Matcher  matcher = regex.matcher(phone);
       boolean isMatched = matcher.matches();
        if (!isMatched) {

        } else {

        }
    }

    //数据
    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        System.out.println("Today is a nice day.".matches("day"));

        test("000000000000000");
        long end = System.currentTimeMillis();
        System.out.print(end-start);
    }
}
